package me.zhengjie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import me.zhengjie.dao.ContainerDao;
import me.zhengjie.dao.StoreLocalDao;
import me.zhengjie.dao.dto.ContainerQueryCriteria;
import me.zhengjie.dao.dto.StoreLocalQueryCriteria;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface StoreLocalMapper extends BaseMapper<StoreLocalDao> {

    IPage<StoreLocalDao> findAll(@Param("criteria") StoreLocalQueryCriteria criteria, Page<Object> page);

    List<StoreLocalDao> findAll(@Param("criteria") StoreLocalQueryCriteria criteria);


    StoreLocalDao findStoreByCode(@Param("floor") String floor,
                                  @Param("region") String region,
                                  @Param("serial") String serial);

    /**
     * 查询空载具列
     *
     * @param floor 楼层
     * @return 空容器列
     */
    List<String> findEmptyStore(@Param("floor") String floor,
                                @Param("isAuxiliaryMaterials") Integer isAuxiliaryMaterials,
                                @Param("goodType") String goodType);

    /**
     * 空储位列
     *
     * @param floor 楼层
     * @return 空储位列
     */
    List<String> findEmptySingleStore(@Param("floor") String floor,
                                      @Param("isAuxiliaryMaterials") Integer isAuxiliaryMaterials,
                                      @Param("goodType") String goodType);


    List<String> findArbitrarySingleStore(@Param("floor") String floor,
                                          @Param("isAuxiliaryMaterials") Integer isAuxiliaryMaterials,
                                          @Param("goodType") String goodType);


    List<StoreLocalDao> getList(ContainerQueryCriteria criteria);

}
